<html>
<head><meta charset="utf-8"><title>Semi-official (non-std::simd) crates · project-portable-simd · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/index.html">project-portable-simd</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Semi-official.20(non-std.3A.3Asimd).20crates.html">Semi-official (non-std::simd) crates</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="211292821"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Semi-official%20%28non-std%3A%3Asimd%29%20crates/near/211292821" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Semi-official.20(non-std.3A.3Asimd).20crates.html#211292821">(Sep 25 2020 at 18:04)</a>:</h4>
<p>Not sure if this is really under the purview of our charter, but it may be a good idea to set the groundwork for some semi-official crates similar to the <code>num-*</code> crates, such as maybe <code>simd-traits</code> and <code>simd-complex</code>.  I think this would allow us to provide some more experimental functionality while still stabilizing the fundamentals.  Thoughts?</p>



<a name="211293873"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Semi-official%20%28non-std%3A%3Asimd%29%20crates/near/211293873" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Semi-official.20(non-std.3A.3Asimd).20crates.html#211293873">(Sep 25 2020 at 18:13)</a>:</h4>
<p>depends? I think it would be better to put those things in the core crate API if they are part of our design. OTOH it's also fine if we build things outside of it that do work like what you are saying, I don't know what the contents you are thinking of are.</p>



<a name="211294032"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Semi-official%20%28non-std%3A%3Asimd%29%20crates/near/211294032" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Semi-official.20(non-std.3A.3Asimd).20crates.html#211294032">(Sep 25 2020 at 18:14)</a>:</h4>
<p>Like, I have used the num-traits crate, to be clear! I just am not entirely sure where you are going with this.</p>



<a name="211294468"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Semi-official%20%28non-std%3A%3Asimd%29%20crates/near/211294468" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Semi-official.20(non-std.3A.3Asimd).20crates.html#211294468">(Sep 25 2020 at 18:18)</a>:</h4>
<p>I think all I'm getting at is there are things that are important enough to be part of the ecosystem but not necessarily complete enough to be stabilized in core, and it might make our jobs a bit easier to make that distinction.</p>



<a name="211294496"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Semi-official%20%28non-std%3A%3Asimd%29%20crates/near/211294496" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Semi-official.20(non-std.3A.3Asimd).20crates.html#211294496">(Sep 25 2020 at 18:18)</a>:</h4>
<p>That's fair.</p>



<a name="211294567"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Semi-official%20%28non-std%3A%3Asimd%29%20crates/near/211294567" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Semi-official.20(non-std.3A.3Asimd).20crates.html#211294567">(Sep 25 2020 at 18:19)</a>:</h4>
<p>I guess my pushback is that if we have core abstraction traits then they should be part of std's API, unless someone can present to me a really good reason for not. It feels kind of absurd to me that Integer, Signed, and Unsigned are not core, for instance. But for simd-complex, yes, that should be a separate crate.</p>



<a name="211294591"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Semi-official%20%28non-std%3A%3Asimd%29%20crates/near/211294591" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Semi-official.20(non-std.3A.3Asimd).20crates.html#211294591">(Sep 25 2020 at 18:20)</a>:</h4>
<p>For example, it would probably be nice to have a trait that all vectors implement indicating number of lanes, scalar type, etc.  But I'm not sure that _must_ be in core, an auxiliary crate might be sufficient</p>



<a name="211294703"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Semi-official%20%28non-std%3A%3Asimd%29%20crates/near/211294703" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Semi-official.20(non-std.3A.3Asimd).20crates.html#211294703">(Sep 25 2020 at 18:20)</a>:</h4>
<p>Yeah, simd-complex must be simply since num-complex isn't in core.</p>



<a name="211295081"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Semi-official%20%28non-std%3A%3Asimd%29%20crates/near/211295081" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Semi-official.20(non-std.3A.3Asimd).20crates.html#211295081">(Sep 25 2020 at 18:23)</a>:</h4>
<p>even just in spirit, I feel doubt about a particular implementation of complex numbers or such being non-core, I guess? But like, Float, Signed, Unsigned? I just feel _weird_ about that decision in 2020.</p>



<a name="211295083"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Semi-official%20%28non-std%3A%3Asimd%29%20crates/near/211295083" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Semi-official.20(non-std.3A.3Asimd).20crates.html#211295083">(Sep 25 2020 at 18:23)</a>:</h4>
<p>I think the biggest argument against putting it in core is that the interface is permanent. Not that num-traits frequently changes, but I think it's broad enough that it could need breaking changes</p>



<a name="211295159"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Semi-official%20%28non-std%3A%3Asimd%29%20crates/near/211295159" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Semi-official.20(non-std.3A.3Asimd).20crates.html#211295159">(Sep 25 2020 at 18:24)</a>:</h4>
<p>That's fair, I do think if something we're not sure of, we should push it out.</p>



<a name="211295343"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Semi-official%20%28non-std%3A%3Asimd%29%20crates/near/211295343" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Semi-official.20(non-std.3A.3Asimd).20crates.html#211295343">(Sep 25 2020 at 18:25)</a>:</h4>
<p>Something came up in my PR for the initial vector types whether or not we should support a vector type of pointers.  I think that would be a good candidate for an auxiliary crate that can be RFC'd in the future</p>



<a name="211295350"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Semi-official%20%28non-std%3A%3Asimd%29%20crates/near/211295350" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Semi-official.20(non-std.3A.3Asimd).20crates.html#211295350">(Sep 25 2020 at 18:25)</a>:</h4>
<p>Rust <em>needs</em> to present an abstraction over vectors, but anything in std should be one we're happy with 20 years later. So nothing should get stabilized before we're 20-years-confident. Because at the very minimum, it would take 3 years to break on an edition boundary. <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span></p>



<a name="211295493"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Semi-official%20%28non-std%3A%3Asimd%29%20crates/near/211295493" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Semi-official.20(non-std.3A.3Asimd).20crates.html#211295493">(Sep 25 2020 at 18:26)</a>:</h4>
<p>Exactly. I'm not confident that num-traits for example will be perfectly fine in 20 years. But f32 itself probably is fine.</p>



<a name="211295536"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Semi-official%20%28non-std%3A%3Asimd%29%20crates/near/211295536" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Semi-official.20(non-std.3A.3Asimd).20crates.html#211295536">(Sep 25 2020 at 18:27)</a>:</h4>
<p>I mean.<br>
f32 needs to exist even if it sucks and has underspecified semantics. &lt;_&lt;</p>



<a name="211295553"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Semi-official%20%28non-std%3A%3Asimd%29%20crates/near/211295553" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Semi-official.20(non-std.3A.3Asimd).20crates.html#211295553">(Sep 25 2020 at 18:27)</a>:</h4>
<p>Heh true</p>



<a name="211295578"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Semi-official%20%28non-std%3A%3Asimd%29%20crates/near/211295578" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Semi-official.20(non-std.3A.3Asimd).20crates.html#211295578">(Sep 25 2020 at 18:27)</a>:</h4>
<p>And that's one thing not covered by the stability promise:<br>
UNDERSPECIFIED SEMANTICS ARE SUBJECT TO CHANGE AT ANY TIME.</p>



<a name="211295704"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Semi-official%20%28non-std%3A%3Asimd%29%20crates/near/211295704" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Semi-official.20(non-std.3A.3Asimd).20crates.html#211295704">(Sep 25 2020 at 18:28)</a>:</h4>
<p>Maybe i32 would have been a better choice for my argument :)</p>



<a name="211295853"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Semi-official%20%28non-std%3A%3Asimd%29%20crates/near/211295853" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Semi-official.20(non-std.3A.3Asimd).20crates.html#211295853">(Sep 25 2020 at 18:29)</a>:</h4>
<p>yeah i32s will be fine~<br>
I actually think it's perfectly appropriate since the problem with f32 is actually that the semantics are underspecified, so we can work around that.</p>



<a name="211295897"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Semi-official%20%28non-std%3A%3Asimd%29%20crates/near/211295897" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Semi-official.20(non-std.3A.3Asimd).20crates.html#211295897">(Sep 25 2020 at 18:29)</a>:</h4>
<p><del>std doesn't _say_ it's an IEEE754 floating point number, just that it's a floating point number. :^)</del><br>
Wait it does. Damn, I was looking in the wrong place!</p>



<a name="211296035"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Semi-official%20%28non-std%3A%3Asimd%29%20crates/near/211296035" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Semi-official.20(non-std.3A.3Asimd).20crates.html#211296035">(Sep 25 2020 at 18:30)</a>:</h4>
<p>Haha I thought it did</p>



<a name="211296068"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Semi-official%20%28non-std%3A%3Asimd%29%20crates/near/211296068" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Semi-official.20(non-std.3A.3Asimd).20crates.html#211296068">(Sep 25 2020 at 18:30)</a>:</h4>
<p>BETTER VERSION: std doesn't say it provides IEEE754 behavior even in the absence of machine support.</p>



<a name="211296157"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Semi-official%20%28non-std%3A%3Asimd%29%20crates/near/211296157" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Semi-official.20(non-std.3A.3Asimd).20crates.html#211296157">(Sep 25 2020 at 18:31)</a>:</h4>
<p><del>though I would actually like it to.</del></p>



<a name="211299114"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Semi-official%20%28non-std%3A%3Asimd%29%20crates/near/211299114" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Semi-official.20(non-std.3A.3Asimd).20crates.html#211299114">(Sep 25 2020 at 18:54)</a>:</h4>
<p>I agree that the vector type over pointers may be a bit too Interesting for core tho', looking at them.</p>
<p>One thing that is happening is that libs is actually discussing changing e.g. Mutex, because it's poison-dependent, and there have been Problems with how that has been handled (esp. in user code), so that sort of particular implementation detail... something that doesn't seem obvious, but is rather an opinionated decision exposed directly in the API, and one that doesn't have a clear alignment so far with Rust's other strong opinions... also seems like a thing to pay attention to.</p>



<a name="211329331"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Semi-official%20%28non-std%3A%3Asimd%29%20crates/near/211329331" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Semi-official.20(non-std.3A.3Asimd).20crates.html#211329331">(Sep 25 2020 at 23:34)</a>:</h4>
<p>So, taking a page from core::ops, we clearly could have some core::simd::ops, and that would be traits of vetical operations like add and mul and bitand and sqrt</p>



<a name="211329353"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Semi-official%20%28non-std%3A%3Asimd%29%20crates/near/211329353" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Semi-official.20(non-std.3A.3Asimd).20crates.html#211329353">(Sep 25 2020 at 23:35)</a>:</h4>
<p>and then we don't need to specify every possible float thing or integer thing all at once</p>



<a name="211329679"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Semi-official%20%28non-std%3A%3Asimd%29%20crates/near/211329679" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Semi-official.20(non-std.3A.3Asimd).20crates.html#211329679">(Sep 25 2020 at 23:41)</a>:</h4>
<p>I assumed we would simply implement core::ops::* for vectors</p>



<a name="211329734"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Semi-official%20%28non-std%3A%3Asimd%29%20crates/near/211329734" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Semi-official.20(non-std.3A.3Asimd).20crates.html#211329734">(Sep 25 2020 at 23:42)</a>:</h4>
<p>The traits in num-traits are generally supertraits of those with some extra functionality</p>



<a name="211332739"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Semi-official%20%28non-std%3A%3Asimd%29%20crates/near/211332739" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Semi-official.20(non-std.3A.3Asimd).20crates.html#211332739">(Sep 26 2020 at 00:44)</a>:</h4>
<p>I also assumed core::ops for simd types. i guess we'd only need the completely new ops to be in core::simd::ops, so like sqrt, cos, sin, etc</p>



<a name="211332760"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Semi-official%20%28non-std%3A%3Asimd%29%20crates/near/211332760" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Semi-official.20(non-std.3A.3Asimd).20crates.html#211332760">(Sep 26 2020 at 00:45)</a>:</h4>
<p>Wouldn't those just be member fns, just like f32 etc?</p>



<a name="211332818"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Semi-official%20%28non-std%3A%3Asimd%29%20crates/near/211332818" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Semi-official.20(non-std.3A.3Asimd).20crates.html#211332818">(Sep 26 2020 at 00:46)</a>:</h4>
<p>Yes, but you want to be able to write generics too</p>



<a name="211332830"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Semi-official%20%28non-std%3A%3Asimd%29%20crates/near/211332830" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Semi-official.20(non-std.3A.3Asimd).20crates.html#211332830">(Sep 26 2020 at 00:46)</a>:</h4>
<p>since every lane count is a different type, we need to be <em>extra</em> generic friendly</p>



<a name="211332839"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Semi-official%20%28non-std%3A%3Asimd%29%20crates/near/211332839" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Semi-official.20(non-std.3A.3Asimd).20crates.html#211332839">(Sep 26 2020 at 00:47)</a>:</h4>
<p>I suppose that is the sort of thing I am proposing to exist in simd-traits as opposed to core</p>



<a name="211332897"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Semi-official%20%28non-std%3A%3Asimd%29%20crates/near/211332897" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Semi-official.20(non-std.3A.3Asimd).20crates.html#211332897">(Sep 26 2020 at 00:48)</a>:</h4>
<p>I think each trait is so simple and obvious that just putting it in core is the simpler route</p>



<a name="211333208"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Semi-official%20%28non-std%3A%3Asimd%29%20crates/near/211333208" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Semi-official.20(non-std.3A.3Asimd).20crates.html#211333208">(Sep 26 2020 at 00:55)</a>:</h4>
<p>Why is num-traits not part of core?  My guess is that it's not quite so obvious</p>



<a name="211333235"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Semi-official%20%28non-std%3A%3Asimd%29%20crates/near/211333235" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Semi-official.20(non-std.3A.3Asimd).20crates.html#211333235">(Sep 26 2020 at 00:56)</a>:</h4>
<p>I think one reason is that once you've defined a supertrait you can't change the subtraits</p>



<a name="211333461"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Semi-official%20%28non-std%3A%3Asimd%29%20crates/near/211333461" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Semi-official.20(non-std.3A.3Asimd).20crates.html#211333461">(Sep 26 2020 at 01:00)</a>:</h4>
<p>One possibility that comes to mind is that core may add another operator that desugars into some trait, but we can't add that as a subtrait to say core::simd::Integer or whatever</p>



<a name="211337867"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Semi-official%20%28non-std%3A%3Asimd%29%20crates/near/211337867" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Semi-official.20(non-std.3A.3Asimd).20crates.html#211337867">(Sep 26 2020 at 02:43)</a>:</h4>
<p>you can probably hunt down the PRs, issues, and RFCs that discuss num-traits and why it isn't in core.</p>



<a name="211337882"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Semi-official%20%28non-std%3A%3Asimd%29%20crates/near/211337882" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Semi-official.20(non-std.3A.3Asimd).20crates.html#211337882">(Sep 26 2020 at 02:43)</a>:</h4>
<p>and if someone does that, we will be significantly more armed for this discussion.</p>



<a name="211338627"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Semi-official%20%28non-std%3A%3Asimd%29%20crates/near/211338627" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Semi-official.20(non-std.3A.3Asimd).20crates.html#211338627">(Sep 26 2020 at 03:00)</a>:</h4>
<p>Well <strong>one</strong> issue is that num-traits is, uh, <em>broad</em> traits. Like, there's <a href="https://docs.rs/num-traits/0.2.12/num_traits/trait.Num.html">Num</a> which requires <em>four</em> traits, and <em>three</em> of those have other required elements themselves. It's complicated, but not in a good way. I'm sure it works well in practice, but it's not <em>obviously</em> the most correct design. There's other designs that you could have </p>
<p>On the other hand, the design of the <code>core::ops</code> traits are <em>way</em> simpler and much more obviously correct. There aren't batches of things that go together. You can impl <code>Add</code> without <code>Mul</code>, without <code>Div</code>, etc etc. By making the traits one op at a time, you <em>do</em> get gross piles of trait bounds on generic math (eg <code>where T: foo+bar+baz+quack+moo+bark</code>), but each trait can be simply understood in isolation, and it can be implemented for each type just fine.</p>



<a name="211339403"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Semi-official%20%28non-std%3A%3Asimd%29%20crates/near/211339403" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Semi-official.20(non-std.3A.3Asimd).20crates.html#211339403">(Sep 26 2020 at 03:21)</a>:</h4>
<p>I think I'm fine with adding the base traits, just skeptical of the supertraits (like Num, Float, Signed, etc).  If any traits can/should be common with scalar types I'm guessing it doesn't belong in the std::simd namespace</p>



<a name="211339560"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Semi-official%20%28non-std%3A%3Asimd%29%20crates/near/211339560" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Semi-official.20(non-std.3A.3Asimd).20crates.html#211339560">(Sep 26 2020 at 03:25)</a>:</h4>
<p>I'd be fine with just recording an official stance that "SIMD types should, by default, implement ops traits vertically", and then leaving more traits to be added to <code>core::num</code> later on. Perhaps a "we also propose the following traits but they can be accepted separately from the main SIMD work"</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>